package com.aaa.dem1101;

/**
 * @Author: whj
 * @Version 1.0
 * @Date: 2022/11/1  13:05
 */
public class Sleep {
    public static void main(String[] args) {
        SleepDemo sleepDemo=new SleepDemo();
        sleepDemo.start();
    }
}
class SleepDemo extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 10; i++) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName()+"---"+i);
        }
    }
}
